package ${package}.${moduleName}.meta.controller;

import cn.iocoder.yudao.framework.common.pojo.BaseController;
import cn.iocoder.yudao.framework.common.pojo.EvgetHttpResult;
import cn.iocoder.yudao.framework.common.pojo.HttpRequestBodyData;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import ${package}.${moduleName}.meta.entity.pojo.${ClassName};
import ${package}.${moduleName}.meta.entity.request.${ClassName}Request;
import ${package}.${moduleName}.meta.entity.request.${ClassName}SelectPageRequest;
import ${package}.${moduleName}.meta.entity.request.${ClassName}SelectRequest;
import ${package}.${moduleName}.meta.entity.response.${ClassName}Response;
import ${package}.${moduleName}.meta.service.${ClassName}Service;
import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

/**
 *
 * ${tableComment}(${functionName}) 前端控制器
 *
 * @author ${author} ${email}
 * @since ${version} ${date}
 */
@RestController
@RequestMapping("/c/v1/wellMudLogAndWireLine/service/${moduleName}/${className}")
public class ${ClassName}Controller extends BaseController {

    @Resource
    private ${ClassName}Service ${className}Service;

    @PostMapping("/other/add")
    @ApiOperation(value = "新增${tableComment}")
    public EvgetHttpResult<Boolean> add(@RequestBody HttpRequestBodyData<${ClassName}Request> requestBodyData) throws IOException {
        return handleRequest(${className}Service::add);
    }

    @PostMapping("/other/addBatch")
    @ApiOperation(value = "批量新增${tableComment}")
    public EvgetHttpResult<Boolean> addBatch(@RequestBody HttpRequestBodyData<List<${ClassName}Request>> requestBodyData) throws IOException {
        return handleRequest(${className}Service::addBatch);
    }

    @PostMapping("/other/deleteByIds")
    @ApiOperation(value = "删除${tableComment}（支持批量）")
    public EvgetHttpResult<Boolean> deleteByIds(@RequestBody HttpRequestBodyData<List<String>> requestBodyData) throws IOException {
        return handleRequest(${className}Service::deleteByIds);
    }

    @PostMapping("/other/update")
    @ApiOperation(value = "更新${tableComment}")
    public EvgetHttpResult<Boolean> updateInfo(@RequestBody HttpRequestBodyData<${ClassName}Request> requestBodyData) throws IOException {
        return handleRequest(${className}Service::updateInfo);
    }

    @PostMapping("/other/updateBatch")
    @ApiOperation(value = "批量更新${tableComment}")
    public EvgetHttpResult<Boolean> updateBatch(@RequestBody HttpRequestBodyData<List<${ClassName}Request>> requestBodyData) throws IOException {
        return handleRequest(${className}Service::updateBatch);
    }

    @GetMapping("/list/getListByIds")
    @ApiOperation(value = "根据id查询${tableComment}")
    public EvgetHttpResult<List<${ClassName}Response>> getListByIds(String ids) throws IOException {
        return handleRequest(${className}Service::getListByIds, "ids");
    }

    @PostMapping("/list/getList")
    @ApiOperation(value = "查询${tableComment}列表")
    public EvgetHttpResult<List<${ClassName}Response>> getList(@RequestBody HttpRequestBodyData<${ClassName}SelectRequest> requestBodyData) throws IOException {
        return handleRequest(${className}Service::getList);
    }

    @PostMapping("/list/get${ClassName}Page")
    @ApiOperation(value = "分页查询${tableComment}列表")
    public EvgetHttpResult<PageResult<${ClassName}>> get${ClassName}Page(@RequestBody HttpRequestBodyData<${ClassName}SelectPageRequest> requestBodyData) throws IOException {
        return handleRequest(${className}Service::get${ClassName}Page);
    }
}
